package com.atguigu.day03;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @author Felix
 * @date 2024/4/1
 * 该案例演示了从指定的集合中读取数据
 */
public class Flink04_Source_Col {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        //从集合中读取数据
        //DataStreamSource<Integer> colDS = env
        //        .fromCollection(Arrays.asList(1, 2, 3, 4, 5));
        DataStreamSource<Integer> colDS = env.fromElements(1, 2, 3, 4, 5);
        colDS.print();
        env.execute();
    }
}
